class Plant < ActiveRecord::Base
  
  set_primary_key 'plntcode'

  belongs_to :company
  has_many :generators
  
  def total_nameplate_capacity
    nameplate = Generator.sum(:nameplate, :conditions => [ "plntcode = ?", self.id ]).to_i
  end
  
end